// SEE END OF FILE FOR LICENSE TERMS

//#include "defines.h"
//#include "options.h"
#include "../libUDB/libUDB.h"

#ifndef MIXER_DEFINES_H
#define MIXER_DEFINES_H



typedef enum
{
	MIX_SRC_AP = 0,
	MIX_SRC_CONTROLS,
	MIX_SRC_RADIO
} MIX_SRCS;


typedef enum
{
	AP_ROLL_CONTROL = 0,
	AP_PITCH_CONTROL,
	AP_YAW_CONTROL,
	AP_THROTTLE_CONTROL,
	AP_CAMBER_CONTROL,
	AP_FLAP_CONTROL,
	AP_SPOILER_CONTROL,
	AP_WAGGLE_CONTROL,
	AP_MAX_CONTROLS
} AP_CONTROLS;

extern int APControls[AP_MAX_CONTROLS];

typedef enum
{
	CONTROL_ROLL = 0,
	CONTROL_PITCH,
	CONTROL_YAW,
	CONTROL_THROTTLE,
	CONTROL_CAMBER,
	CONTROL_FLAP,
	CONTROL_SPOILER,
	CONTROL_MAX
} MIX_CONTROLS;

extern int mixControls[CONTROL_MAX];

const unsigned char controlMixCount;
const unsigned char channelMixCount;

typedef struct tagMIXER_SETTINGS
{
	int 	posCoeff;
	int 	negCoeff;
	unsigned int sourceIndex		: 5	;	// Either APCommand[Source] or pwIn[Source]
	unsigned int destIndex			: 5	;	// 
	unsigned int source				: 2 ;	// mixer source
	unsigned int Unused				: 4 ;	// Unused bits
} MIXER_SETTINGS;


typedef struct tagOUTPUT_SCALING
{
	char	offset;
	char	max;
	char	min;
	char	trimSrc;
} OUTPUT_SCALING;

extern int outputScaling[MAX_OUTPUTS+1];

#endif

/****************************************************************************/
// This is part of the servo and radio interface software
//
// ServoInterface source code
//	http://code.google.com/p/rc-servo-interface
//
// Copyright 2010 ServoInterface Team
// See the AUTHORS.TXT file for a list of authors of ServoInterface.
//
// ServoInterface is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ServoInterface is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License 
// along with ServoInterface.  If not, see <http://www.gnu.org/licenses/>.
//
// Many parts of ServoInterface use either modified or unmodified code
// from the MatrixPilot pilot project.
// The project also contains code for modifying MatrixPilot to operate
// with ServoInterface.
// For details, credits and licenses of MatrixPilot see the AUTHORS.TXT file.
// or see this website: http://code.google.com/p/gentlenav
/****************************************************************************/
